import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/education_summary_top_entity.dart';

EducationSummaryTopEntity $EducationSummaryTopEntityFromJson(Map<String, dynamic> json) {
  final EducationSummaryTopEntity educationSummaryTopEntity = EducationSummaryTopEntity();
  final int? averageScore = jsonConvert.convert<int>(json['averageScore']);
  if (averageScore != null) {
    educationSummaryTopEntity.averageScore = averageScore;
  }
  final int? finishHours = jsonConvert.convert<int>(json['finishHours']);
  if (finishHours != null) {
    educationSummaryTopEntity.finishHours = finishHours;
  }
  final int? ranking = jsonConvert.convert<int>(json['ranking']);
  if (ranking != null) {
    educationSummaryTopEntity.ranking = ranking;
  }
  final int? textbookCount = jsonConvert.convert<int>(json['textbookCount']);
  if (textbookCount != null) {
    educationSummaryTopEntity.textbookCount = textbookCount;
  }
  final int? trainingHours = jsonConvert.convert<int>(json['trainingHours']);
  if (trainingHours != null) {
    educationSummaryTopEntity.trainingHours = trainingHours;
  }
  return educationSummaryTopEntity;
}

Map<String, dynamic> $EducationSummaryTopEntityToJson(EducationSummaryTopEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['averageScore'] = entity.averageScore;
  data['finishHours'] = entity.finishHours;
  data['ranking'] = entity.ranking;
  data['textbookCount'] = entity.textbookCount;
  data['trainingHours'] = entity.trainingHours;
  return data;
}

extension EducationSummaryTopEntityExtension on EducationSummaryTopEntity {
  EducationSummaryTopEntity copyWith({
    int? averageScore,
    int? finishHours,
    int? ranking,
    int? textbookCount,
    int? trainingHours,
  }) {
    return EducationSummaryTopEntity()
      ..averageScore = averageScore ?? this.averageScore
      ..finishHours = finishHours ?? this.finishHours
      ..ranking = ranking ?? this.ranking
      ..textbookCount = textbookCount ?? this.textbookCount
      ..trainingHours = trainingHours ?? this.trainingHours;
  }
}
